var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
	res.render('index', {
		title: 'Express'
	});
});
//登陆方法
router.post('/login/dologin', function(req, res, next) {
	res.json({
		"code": "200",
		"message": "SUCCESS"
	});
});
//修改密码
router.post('/user/updateUser', function() {
	res.json({
		"code": "200",
		"message": "SUCCESS",
		"data": {
			"updateResultMessage": "更新成功",
		}
	})
});
//请求主题排序
router.post('/postThemes', function(req, res, next) {
	res.send({
		"code": "200",
		"message": "SUCCESS",
		"data": {
			"themes": ["dark", "light", "primary"],
			"checked": "light"
		}
	});
});
//用户列表
router.post('/userInfo', function(req, res, next) {
	res.send({
		name: '张三',
		sex: '男',
		tel: '136464685814',
		level: '1',
		mail: '1104242515@qq.com',
		address: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
		number: '134654',
		department: 'XXX',
		organize: 'XXX',
		environment: 'XXX',
		year: '2016'
	});
});

router.post('/user/query', function(req, res, next) {
	console.log(req.body);
	// res.send({
	//
	// })
})

module.exports = router;